<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>过渡动画</title>
    <script src="scripts/jquery-3.4.1.min.js"></script>
    <script src="scripts/vue.js"></script>
    <style>
        .content{
            width: 200px;
            height: 200px;
            background-color: skyblue;
            margin: 0;
        }
        .fade-enter-active,.fade-leave-active{
            transition: transform 5s;
        }
        .fade-enter,.fade-leave-to{
            /* opacity: 0; */
            transform: translateX(500px);
        }
    </style>
</head>
<body>
    <div id="app">
        <transition name="fade">
            <div v-if="isShow" class="content"></div>
        </transition>
        <button @click="ToogleEvent">切换内容</button>
    </div>

    <script>
        let app=new Vue({
            el:"#app",
            data:{
                isShow:true
            },
            methods:{
                ToogleEvent:function(){
                    this.isShow=!this.isShow;
                }
            },
            watch:{

            }
        })
    </script>
</body>
</html>